

interface Shoe{
    readonly purpose : string
}

class BalletFlat implements Shoe{
    purpose: string = "Ballet Flat"
}

class Boot implements Shoe {
    purpose: string = "woodcutting"
}

function myrun(){
    let shoe = {
        create(type: 'ball' | 'boot'):Shoe{
            switch(type){
                case 'ball': return new BalletFlat
                case 'boot': return new Boot
            }
        }
    }

    console.log(shoe.create("ball").purpose);
    console.log(shoe.create("boot").purpose);
}

myrun()